package com.zhl.scheduling.model.vo;


import com.zhl.scheduling.model.constant.UserType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: ZhangLu In DLUT
 * @since: 1.0.0
 * @Description: 登录的信息封装类
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "LoginVO对象",description = "封装的登录信息实体")
public class LoginVO {
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(dataType = "string",required = true, value = "用户名")
    private String username;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(dataType = "string",required = true, value = "用户密码")
    private String password;

    @NotNull(message = "必须选择用户类型")
    @Range(min = UserType.USER, max = UserType.ADMIN, message = "无效的用户类型")
    @ApiModelProperty(dataType = "int",required = true, value = "用户角色")
    private Integer userType;
}
